Skip to content

fix: Clear empty FDv2 selectors in shared protocol handling - #261

Merged
kinyoklion merged 2 commits into
mainfrom
devin/1794591805-fdv2-selectorless
Nov 18, 2026
Merged

kinyoklion merged 2 commits into
mainfrom
devin/1794591805-fdv2-selectorless

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

launchdarkly/ld-relay#979 sends FDv2 full transfers with no selector (payload-transferred {"state":"","version":0}). The shared FDv2ProtocolHandler built Selector.make(0, "") from it, and that selector is not empty. As a result, the server SDK and Android sent an empty basis= on later polls and stream reconnects. The contract test for this is launchdarkly/sdk-test-harness#600.

Describe the solution you've provided

  • FDv2ProtocolHandler (shared internal): an empty transferred state now becomes Selector.EMPTY. The existing store assignment then clears the held selector. The server polling and streaming requests already check isEmpty(), so they leave out basis.
  • Tests: the shared handler moving from a selector-bearing transfer to a selectorless one, with both populated and empty payloads, plus a non-empty state at version 0. Server tests confirm that polling and streaming leave out basis once the selector is empty.
  • Selector-bearing behavior and initialization are unchanged.

Android uses this shared handler. It needs an internal dependency bump after release (it currently pins 1.9.0). The Java server SDK pins 1.12.2.

Describe alternatives you've considered

Guarding each request builder against an empty state. Normalizing once in the shared handler fixes server and Android in one place.

Additional context

I couldn't verify this locally. Maven Central returned HTTP 429 during Gradle dependency resolution, so tests, Checkstyle, and the selectorless contract group did not run. CI is the first real check.

Link to Devin session: https://app.devin.ai/sessions/f3b22e19bdde48f1b39f77808077390b
Open in Devin Desktop: https://app.devin.ai/desktop/session/f3b22e19bdde48f1b39f77808077390b?variant=devin
Requested by: @kinyoklion


Note

Overview
Fixes FDv2 clients sending an invalid basis= query after a selectorless full transfer (payload-transferred with empty state).

Shared protocol: FDv2ProtocolHandler now maps an empty transferred state to Selector.EMPTY instead of Selector.make(version, ""), which was still treated as non-empty and caused later polls/stream connects to include basis=.

Tests: Shared handler cases for selectorless full transfers and version-0 state with a non-empty id; server tests assert polling and streaming omit basis when the held selector is empty. Normal selector-bearing transfers are unchanged.

Reviewed by Cursor Bugbot for commit 6b4d555. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion
kinyoklion marked this pull request as ready for review November 18, 2026 19:08
@kinyoklion
kinyoklion requested a review from a team as a code owner November 18, 2026 19:08
@cursor cursor Bot added the risk:low label Nov 18, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low.

Automated risk review (dry run): Low

This PR would be automatically approved.

Why: A one-line change in FDv2ProtocolHandler maps empty FDv2 payload state to Selector.EMPTY, with new tests in the shared handler and server poll/stream paths. Bugbot completed with no findings, and this is not infra, auth, or policy configuration.

If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.

Open in Web View Automation 

Sent by Cursor Approval Agent: Dry-Run PR Approver

@kinyoklion
kinyoklion merged commit 576b081 into main Nov 18, 2026
33 checks passed
@kinyoklion
kinyoklion deleted the devin/1794591805-fdv2-selectorless branch November 18, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants